package org.accp.controller;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.accp.dao.DepartmentDao;

import org.accp.pojo.Department;
import org.accp.pojo.Hisrole;
import org.accp.utils.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;

@RequestMapping("/Department")
@Controller
@CrossOrigin("*")
public class DepartmentController {
    @Autowired
    private DepartmentDao departmentDao;

    @RequestMapping("/search")
    @ResponseBody
    public List<Department> search() throws Exception {
        return departmentDao.getAll();
    }
}